package org.jeecg.modules.wflow.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.wflow.bean.entity.WflowCcTasks;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author : willian fu
 * @date : 2022/9/8
 */
public interface WflowCcTasksMapper extends BaseMapper<WflowCcTasks> {

    @Insert({"<script>" +
            "INSERT INTO wflow_cc_tasks (instance_id, user_id, node_id, node_name, create_time) VALUES\n" +
            "  <foreach collection =\"tasks\" item=\"t\" separator =\",\">\n" +
            "    (#{t.instanceId}, #{t.userId}, #{t.nodeId}, #{t.nodeName}, #{t.createTime})\n" +
            "  </foreach >" +
            "</script>"})
    int insertBatch(@Param("tasks") List<WflowCcTasks> tasks);
}
